package cn.jbolt.admin.xd.utils;

import cn.jbolt.common.model.xd.XdScmCustomer;
import cn.jbolt.common.model.xd.XdScmProduct;
import cn.jbolt.common.model.xd.XdScmSupplier;
import cn.jbolt.common.model.xd.XdScmTeam;
import cn.jbolt.core.base.config.JBoltConfig;
import com.jfinal.plugin.activerecord.ActiveRecordPlugin;
import com.jfinal.plugin.druid.DruidPlugin;

public class XdDBUtils {

    public static void contect(){
        DruidPlugin druidPlugin = JBoltConfig.createDruidPlugin();
        // 配置ActiveRecord插件
        ActiveRecordPlugin arp = new ActiveRecordPlugin(druidPlugin);
        arp.addMapping("xd_scm_product","id", XdScmProduct.class);
        arp.addMapping("xd_scm_customer","id", XdScmCustomer.class);
        arp.addMapping("xd_scm_team","id", XdScmTeam.class);
        arp.addMapping("xd_scm_supplier","id", XdScmSupplier.class);
        druidPlugin.start();
        arp.start();
    }


}
